import request from '@/utils/request'

// 查询查评事件列表
export function listEvent(query) {
  return request({
    url: '/system/event/list',
    method: 'get',
    params: query
  })
}
export function getTreeHx(query) {
  return request({
    url: '/system/event/getTreeHx',
    method: 'get',
    params: query
  })
}

export function getEventsDataById(query) {
  return request({
    url: '/system/event/getEventsDataById',
    method: 'get',
    params: query
  })
}
// 查询查评事件列表
export function listEventReview(query) {
  return request({
    url: '/system/event/listEventReview',
    method: 'get',
    params: query
  })
}
// 报告导出
export function inspectionReport(data) {
  return request({
    url: '/system/event/inspectionReport',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}
// 小结导出
export function summaryExport(data) {
  return request({
    url: '/system/event/summaryExport',
    method: 'post',
    data: data,
    responseType: 'blob',
  })
}

// 预览
export function previewPdf(event) {
  return request({
    url: '/system/event/previewPdf/' +event,
    method: 'get',
  })
}

// 查询查评事件详细
export function getEvent(ID) {
  return request({
    url: '/system/event/' + ID,
    method: 'get'
  })
}

// 查询事件标题
export function eventTitle(reviewEvents) {
  return request({
    url: '/system/event/eventTitle/' + reviewEvents,
    method: 'get'
  })
}
// 查询部门
export function queryDept(name) {
  return request({
    url: '/system/event/queryDept/' + name,
    method: 'get'
  })
}

// 新增查评事件
export function addEvent(data) {
  return request({
    url: '/system/event',
    method: 'post',
    timeout: 60000,
    data: data
  })
}

// 修改查评事件
export function updateEvent(data) {
  return request({
    url: '/system/event',
    method: 'put',
    timeout: 60000,
    data: data
  })
}

// 删除查评事件
export function delEvent(ID) {
  return request({
    url: '/system/event/' + ID,
    method: 'delete'
  })
}
// 查询查评事件列表
export function listEventNew(query) {
  return request({
    url: '/system/event/listEventNew',
    method: 'get',
    params: query
  })
}
// 首页图标数据
export function statistics(data) {
  return request({
    url: '/system/event/statistics',
    method: 'post',
    timeout: 60000,
    data: data
  })
}